$("[name='exportExcel']").on('click',function () {

    var checkStatus = layui.table.checkStatus("tableList");
    var checkData = checkStatus.data;

    let ids = [];
    for (let i in checkData){
        if(checkData[i]['Id'] == undefined){
            continue;
        }
        ids.push(checkData[i]['Id'])
    }

    let params = {
        ids:ids,
        ServiceType:$('[name="ServiceType"]').val(),
        SalesPlatform:$('[name="SalesPlatform"]').val(),
        Other:$('[name="Other"]').val(),
        OtherText:$('[name="OtherText"]').val(),
        beginDate:$("[name='beginDate']").val(),
        endDate:$("[name='endDate']").val()
    };

    xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        var a;
        if (xhttp.readyState === 4 && xhttp.status === 200) {
            // Trick for making downloadable link
            a = document.createElement('a');
            a.href = window.URL.createObjectURL(xhttp.response);
            // Give filename you wish to download
            a.download = "客户咨询.xls";
            a.style.display = 'none';
            document.body.appendChild(a);
            a.click();
        }
    };
    xhttp.open("POST", '/clientConsultationListExport');
    xhttp.setRequestHeader("Content-Type", "application/json");
    xhttp.responseType = 'blob';
    xhttp.send(JSON.stringify(params));
});